package com.wicket.okrframework.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrframework.biz.service.MemberService;
import com.wicket.okrframework.biz.service.dto.req.*;
import com.wicket.okrframework.biz.service.dto.res.*;
import com.wicket.okrframework.common.ro.OkrResult;
import com.wicket.okrframework.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/base/member/")
public class MemberController {

    @Autowired
    MemberService memberService;

    /**
   * D1-2查询组织下成员列表（边界）
   */
    @PostMapping("queryOrgMemberListBorder")
    public OkrResult<QueryOrgMemberListBorderRespDto> queryOrgMemberListBorder(@RequestBody @Validated QueryOrgMemberListBorderReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryOrgMemberListBorderRespDto retData = memberService.queryOrgMemberListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2查询角色人员列表（边界）
   */
    @PostMapping("queryRoleRelListBorder")
    public OkrResult<QueryRoleRelListBorderRespDto> queryRoleRelListBorder(@RequestBody @Validated QueryRoleRelListBorderReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryRoleRelListBorderRespDto retData = memberService.queryRoleRelListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2取消设员工无效
   */
    @PostMapping("cancelIsinvalidSetStaffMember")
    public OkrResult<CancelIsinvalidSetStaffMemberRespDto> cancelIsinvalidSetStaffMember(@RequestBody @Validated CancelIsinvalidSetStaffMemberReqDto reqDTO){
    return OkrResult.success(memberService.cancelIsinvalidSetStaffMember(reqDTO));
    }

    /**
   * D1-2设员工无效
   */
    @PostMapping("inValidIsinvalidSetStaffMember")
    public OkrResult<InValidIsinvalidSetStaffMemberRespDto> inValidIsinvalidSetStaffMember(@RequestBody @Validated InValidIsinvalidSetStaffMemberReqDto reqDTO){
    return OkrResult.success(memberService.inValidIsinvalidSetStaffMember(reqDTO));
    }

    /**
   * D1-2查询员工身份人员列表
   */
    @PostMapping("queryStaffBeginMemberList")
    public OkrResult<QueryStaffBeginMemberListRespDto> queryStaffBeginMemberList(@RequestBody @Validated QueryStaffBeginMemberListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryStaffBeginMemberListRespDto retData = memberService.queryStaffBeginMemberList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2查询角色人员详情
   */
    @PostMapping("queryRoleRelDetail")
    public OkrResult<QueryRoleRelDetailRespDto> queryRoleRelDetail(@RequestBody @Validated QueryRoleRelDetailReqDto reqDTO){
    return OkrResult.success(memberService.queryRoleRelDetail(reqDTO));
    }

    /**
   * D1-2查询角色人员列表
   */
    @PostMapping("queryRoleRelList")
    public OkrResult<QueryRoleRelListRespDto> queryRoleRelList(@RequestBody @Validated QueryRoleRelListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryRoleRelListRespDto retData = memberService.queryRoleRelList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2新增角色人员
   */
    @PostMapping("addRoleRel")
    public OkrResult<AddRoleRelRespDto> addRoleRel(@RequestBody @Validated AddRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.addRoleRel(reqDTO));
    }

    /**
   * D1-2新增员工身份人员
   */
    @PostMapping("addStaffBeginMember")
    public OkrResult<AddStaffBeginMemberRespDto> addStaffBeginMember(@RequestBody @Validated AddStaffBeginMemberReqDto reqDTO){
    return OkrResult.success(memberService.addStaffBeginMember(reqDTO));
    }

    /**
   * D1-新增空间管理员角色人员（平台）
   */
    @PostMapping("addAdminRoleRel")
    public OkrResult<AddAdminRoleRelRespDto> addAdminRoleRel(@RequestBody @Validated AddAdminRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.addAdminRoleRel(reqDTO));
    }

    /**
   * D1-3查询去重部门员工列表
   */
    @PostMapping("queryFilterDeptSatffList")
    public OkrResult<QueryFilterDeptSatffListRespDto> queryFilterDeptSatffList(@RequestBody @Validated QueryFilterDeptSatffListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryFilterDeptSatffListRespDto retData = memberService.queryFilterDeptSatffList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2查询员工去重角色人员列表（边界）
   */
    @PostMapping("queryStaffFilterRoleRelListBorder")
    public OkrResult<QueryStaffFilterRoleRelListBorderRespDto> queryStaffFilterRoleRelListBorder(@RequestBody @Validated QueryStaffFilterRoleRelListBorderReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryStaffFilterRoleRelListBorderRespDto retData = memberService.queryStaffFilterRoleRelListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3查询组织员工列表（边界）
   */
    @PostMapping("queryOrgStaffList")
    public OkrResult<QueryOrgStaffListRespDto> queryOrgStaffList(@RequestBody @Validated QueryOrgStaffListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryOrgStaffListRespDto retData = memberService.queryOrgStaffList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2修改身份人员资料
   */
    @PostMapping("updateBeginMembInfo")
    public OkrResult<UpdateBeginMembInfoRespDto> updateBeginMembInfo(@RequestBody @Validated UpdateBeginMembInfoReqDto reqDTO){
    return OkrResult.success(memberService.updateBeginMembInfo(reqDTO));
    }

    /**
   * D1-2查询身份人员列表
   */
    @PostMapping("queryBeginMemberList")
    public OkrResult<QueryBeginMemberListRespDto> queryBeginMemberList(@RequestBody @Validated QueryBeginMemberListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryBeginMemberListRespDto retData = memberService.queryBeginMemberList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2查询身份人员列表（边界）
   */
    @PostMapping("queryBeginMemberListBorder")
    public OkrResult<QueryBeginMemberListBorderRespDto> queryBeginMemberListBorder(@RequestBody @Validated QueryBeginMemberListBorderReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryBeginMemberListBorderRespDto retData = memberService.queryBeginMemberListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3取消异动员工身份人员
   */
    @PostMapping("cancelTransactionStaffBeginMember")
    public OkrResult<CancelTransactionStaffBeginMemberRespDto> cancelTransactionStaffBeginMember(@RequestBody @Validated CancelTransactionStaffBeginMemberReqDto reqDTO){
    return OkrResult.success(memberService.cancelTransactionStaffBeginMember(reqDTO));
    }

    /**
   * D1-3设异动员工身份人员
   */
    @PostMapping("inTransactionStaffBeginMember")
    public OkrResult<InTransactionStaffBeginMemberRespDto> inTransactionStaffBeginMember(@RequestBody @Validated InTransactionStaffBeginMemberReqDto reqDTO){
    return OkrResult.success(memberService.inTransactionStaffBeginMember(reqDTO));
    }

    /**
   * D1-3存档员工身份人员
   */
    @PostMapping("archiveBeginMember")
    public OkrResult<ArchiveBeginMemberRespDto> archiveBeginMember(@RequestBody @Validated ArchiveBeginMemberReqDto reqDTO){
    return OkrResult.success(memberService.archiveBeginMember(reqDTO));
    }

    /**
   * D1-2查询员工身份人员详情
   */
    @PostMapping("queryStaffBeginMemberDetail")
    public OkrResult<QueryStaffBeginMemberDetailRespDto> queryStaffBeginMemberDetail(@RequestBody @Validated QueryStaffBeginMemberDetailReqDto reqDTO){
    return OkrResult.success(memberService.queryStaffBeginMemberDetail(reqDTO));
    }

    /**
     * D1-2查询部门员工列表（边界）
     */
    @PostMapping("queryDeptDirectStaffListBorder")
    public OkrResult<QueryDeptDirectStaffListBorderRespDto> queryDeptDirectStaffListBorder(@RequestBody @Validated QueryDeptDirectStaffListBorderReqDto reqDTO) {
        Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(), reqDTO.getPageSize());

        QueryDeptDirectStaffListBorderRespDto retData = memberService.queryDeptDirectStaffListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);

    }

    /**
   * D1-2存档部门管理员
   */
    @PostMapping("archiveDeptAdminRoleRel")
    public OkrResult<ArchiveDeptAdminRoleRelRespDto> archiveDeptAdminRoleRel(@RequestBody @Validated ArchiveDeptAdminRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.archiveDeptAdminRoleRel(reqDTO));
    }

    /**
   * D1-2新增部门管理员
   */
    @PostMapping("addDeptAdminRoleRel")
    public OkrResult<AddDeptAdminRoleRelRespDto> addDeptAdminRoleRel(@RequestBody @Validated AddDeptAdminRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.addDeptAdminRoleRel(reqDTO));
    }

    /**
   * D1-2查询部门管理员列表
   */
    @PostMapping("queryDeptAdminRoleRelList")
    public OkrResult<QueryDeptAdminRoleRelListRespDto> queryDeptAdminRoleRelList(@RequestBody @Validated QueryDeptAdminRoleRelListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryDeptAdminRoleRelListRespDto retData = memberService.queryDeptAdminRoleRelList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-2删除角色人员
   */
    @PostMapping("deleteRoleRel")
    public OkrResult<DeleteRoleRelRespDto> deleteRoleRel(@RequestBody @Validated DeleteRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.deleteRoleRel(reqDTO));
    }

    /**
     * D1-2修改角色人员
     */
    @PostMapping("updateRoleRel")
    public OkrResult<UpdateRoleRelRespDto> updateRoleRel(@RequestBody @Validated UpdateRoleRelReqDto reqDTO) {
        return OkrResult.success(memberService.updateRoleRel(reqDTO));
    }
/**
   * D1-2删除部门管理员(管理)
   */
    @PostMapping("deleteDeptAdminRoleRel")
    public OkrResult<DeleteDeptAdminRoleRelRespDto> deleteDeptAdminRoleRel(@RequestBody @Validated DeleteDeptAdminRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.deleteDeptAdminRoleRel(reqDTO));
    }
/**
   * D1-2查询角色标识匹配结果详情
   */
    @PostMapping("queryRoleCodeMatchingResultsDetail")
    public OkrResult<QueryRoleCodeMatchingResultsDetailRespDto> queryRoleCodeMatchingResultsDetail(@RequestBody @Validated QueryRoleCodeMatchingResultsDetailReqDto reqDTO){
    return OkrResult.success(memberService.queryRoleCodeMatchingResultsDetail(reqDTO));
    }
/**
   * D1-2判断用户唯一资料(公共)
   */
    @PostMapping("judgeUserOnlyInfoCom")
    public OkrResult<JudgeUserOnlyInfoComRespDto> judgeUserOnlyInfoCom(@RequestBody @Validated JudgeUserOnlyInfoComReqDto reqDTO){
    return OkrResult.success(memberService.judgeUserOnlyInfoCom(reqDTO));
    }
/**
   * D1判断注册完善员工操作可用(公共)
   */
    @PostMapping("judgeAddPerfectStaffUsableCom")
    public OkrResult<JudgeAddPerfectStaffUsableComRespDto> judgeAddPerfectStaffUsableCom(@RequestBody @Validated JudgeAddPerfectStaffUsableComReqDto reqDTO){
    return OkrResult.success(memberService.judgeAddPerfectStaffUsableCom(reqDTO));
    }
/**
   * D1-2判断用户唯一资料是否修改(公共)
   */
    @PostMapping("judgeJudgeUserOnlyInfoUpdateCom")
    public OkrResult<JudgeJudgeUserOnlyInfoUpdateComRespDto> judgeJudgeUserOnlyInfoUpdateCom(@RequestBody @Validated JudgeJudgeUserOnlyInfoUpdateComReqDto reqDTO){
    return OkrResult.success(memberService.judgeJudgeUserOnlyInfoUpdateCom(reqDTO));
    }
/**
   * D1-2批量查角色人员(边界)
   */
    @PostMapping("batchQueryRoleRelBorder")
    public OkrResult<BatchQueryRoleRelBorderRespDto> batchQueryRoleRelBorder(@RequestBody @Validated BatchQueryRoleRelBorderReqDto reqDTO){
    return OkrResult.success(memberService.batchQueryRoleRelBorder(reqDTO));
    }
/**
   * D1-2查询字母身份人员列表
   */
    @PostMapping("queryLetterBeginMemberList")
    public OkrResult<QueryLetterBeginMemberListRespDto> queryLetterBeginMemberList(@RequestBody @Validated QueryLetterBeginMemberListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryLetterBeginMemberListRespDto retData = memberService.queryLetterBeginMemberList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }
/**
   * D1-2存档角色人员
   */
    @PostMapping("archiveRoleRel")
    public OkrResult<ArchiveRoleRelRespDto> archiveRoleRel(@RequestBody @Validated ArchiveRoleRelReqDto reqDTO){
    return OkrResult.success(memberService.archiveRoleRel(reqDTO));
    }
/**
   * D1-3查询角色人员详情(公共)
   */
    @PostMapping("queryRoleRelDetailCom")
    public OkrResult<QueryRoleRelDetailComRespDto> queryRoleRelDetailCom(@RequestBody @Validated QueryRoleRelDetailComReqDto reqDTO){
    return OkrResult.success(memberService.queryRoleRelDetailCom(reqDTO));
    }
/**
   * D1查询成员个人资料详情(公共)
   */
    @PostMapping("queryMemberProfileDetailCom")
    public OkrResult<QueryMemberProfileDetailComRespDto> queryMemberProfileDetailCom(@RequestBody @Validated QueryMemberProfileDetailComReqDto reqDTO){
    return OkrResult.success(memberService.queryMemberProfileDetailCom(reqDTO));
    }
/**
   * D1批量查成员个人资料列表(公共)
   */
    @PostMapping("batchQueryMemberProfileListByIdsCom")
    public OkrResult<BatchQueryMemberProfileListByIdsComRespDto> batchQueryMemberProfileListByIdsCom(@RequestBody @Validated BatchQueryMemberProfileListByIdsComReqDto reqDTO){
    return OkrResult.success(memberService.batchQueryMemberProfileListByIdsCom(reqDTO));
    }
/**
   * D1查角色人员信息(公共)
   */
    @PostMapping("queryRoleRelInfoDetailCom")
    public OkrResult<QueryRoleRelInfoDetailComRespDto> queryRoleRelInfoDetailCom(@RequestBody @Validated QueryRoleRelInfoDetailComReqDto reqDTO){
    return OkrResult.success(memberService.queryRoleRelInfoDetailCom(reqDTO));
    }
/**
   * D1查询个人手机号等列表(公共)
   */
    @PostMapping("queryPersonPhoneNumEtcListCom")
    public OkrResult<QueryPersonPhoneNumEtcListComRespDto> queryPersonPhoneNumEtcListCom(@RequestBody @Validated QueryPersonPhoneNumEtcListComReqDto reqDTO){
    return OkrResult.success(memberService.queryPersonPhoneNumEtcListCom(reqDTO));
    }
/**
   * D1查询身份人员列表(公共)
   */
    @PostMapping("queryBeginMemberListCom")
    public OkrResult<QueryBeginMemberListComRespDto> queryBeginMemberListCom(@RequestBody @Validated QueryBeginMemberListComReqDto reqDTO){
    return OkrResult.success(memberService.queryBeginMemberListCom(reqDTO));
    }
/**
   * D1查询身份人员资料列表(公共)
   */
    @PostMapping("queryBeginMembInfoListCom")
    public OkrResult<QueryBeginMembInfoListComRespDto> queryBeginMembInfoListCom(@RequestBody @Validated QueryBeginMembInfoListComReqDto reqDTO){
    return OkrResult.success(memberService.queryBeginMembInfoListCom(reqDTO));
    }
/**
   * D1执行循环部门群成员通道关系处理(公共)
   */
    @PostMapping("implementLoopDeptGroupMemberChannelExitProcessCom")
    public OkrResult<ImplementLoopDeptGroupMemberChannelExitProcessComRespDto> implementLoopDeptGroupMemberChannelExitProcessCom(@RequestBody @Validated ImplementLoopDeptGroupMemberChannelExitProcessComReqDto reqDTO){
    return OkrResult.success(memberService.implementLoopDeptGroupMemberChannelExitProcessCom(reqDTO));
    }
/**
   * D1执行组织群成员通道关系处理(公共)
   */
    @PostMapping("implementOrgGroupMemberChannelExitProcessCom")
    public OkrResult<ImplementOrgGroupMemberChannelExitProcessComRespDto> implementOrgGroupMemberChannelExitProcessCom(@RequestBody @Validated ImplementOrgGroupMemberChannelExitProcessComReqDto reqDTO){
    return OkrResult.success(memberService.implementOrgGroupMemberChannelExitProcessCom(reqDTO));
    }
/**
   * D1查询身份人员详情(公共)
   */
    @PostMapping("queryBeginMemberDetailCom")
    public OkrResult<QueryBeginMemberDetailComRespDto> queryBeginMemberDetailCom(@RequestBody @Validated QueryBeginMemberDetailComReqDto reqDTO){
    return OkrResult.success(memberService.queryBeginMemberDetailCom(reqDTO));
    }
/**
   * D1查询空间成员详情(公共)
   */
    @PostMapping("queryMemberDetailCom")
    public OkrResult<QueryMemberDetailComRespDto> queryMemberDetailCom(@RequestBody @Validated QueryMemberDetailComReqDto reqDTO){
    return OkrResult.success(memberService.queryMemberDetailCom(reqDTO));
    }
}
